<!-- personal 页面内容 -->
<section class="personal" ng-controller="personalCtrl">
    <!-- Nav tabs -->
    <ul class="nav nav-tabs nav-pills" role="tablist">
        <li role="presentation" ng-click="setTypePersonal(1);" ng-class="{'active': tab_type == 1}"><a href="javascript:void(0);" role="tab" data-toggle="tab">个人资料</a></li>
        <li role="presentation" ng-if="user_role != 0" ng-click="setTypePersonal(2);" ng-class="{'active': tab_type == 2}">
            <a href="javascript:void(0);" role="tab" data-toggle="tab" ng-if='user_role == 2'>认证资料</a>
            <a href="javascript:void(0);" role="tab" data-toggle="tab" ng-if='user_role == 1'>公司资料</a>
        </li>
        <li role="presentation" ng-click="setTypePersonal(3);" ng-class="{'active': tab_type == 3}"><a href="javascript:void(0);" role="tab" data-toggle="tab">提现方式</a></li>
    </ul>
    <!-- Tab panes -->
    <div class="tab-content">
        <div ng-show="tab_type == 1">
            <div class="panel panel-default yf-shadow">
                <div class="panel-body">
                    <form name='changeuserform' role="form" novalidate ng-submit="putUser(changeuserform.$invalid, currentUser);">
                    		<div class="form-group">
                            <label for="pic">头像</label>
                            <input type="file" style='display: none;' class="form-control" ng-model='currentUser.headimg' id="pic" placeholder="头像" required>
                            <img class="img-circle" ng-src="{{ currentUser.headimg.url }}?imageView2/1/w/200/h/200/interlace/1" id='img' onerror="this.src='components/mine/imgs/image.jpg'" onclick='document.getElementById("pic").click()'>
                        </div>
                        <div class="form-group">
                            <span for="name">姓名</span><input type="text" class="form-control input_style" ng-model='currentUser.real_name' name='real_name' ng-pattern="/^[A-Za-z0-9\u4e00-\u9fa5]{2,20}$/" id="name" placeholder="姓名" required>
                        </div>
                        <div class="form-group error-container" ng-show="ischangeuserform && (changeuserform.real_name.$error.pattern || changeuserform.real_name.$error.required)">
                            请输入长度 2-20位的名字(中文，字母，数字组成)！
                        </div>
                        <div class="form-group" ng-if="user_role == 2 || currentUser.company_id ">
                            <label for="region">所属渠道</label>
                            <!-- <input type="text" class="form-control" ng-model='currentUser.region' name='region' ng-pattern="/^[A-Za-z0-9\u4e00-\u9fa5]{2,20}$/" id="region" placeholder="所属渠道" required> -->
                            <select ng-model="currentUser.region" ng-options="canal.content as canal.content for canal in canals">
                                <option value="" selected>选择渠道</option>
                            </select>
                        </div>
                        <div ng-if="user_role == 2 || currentUser.company_id " class="form-group error-container" ng-show="ischangeuserform && (changeuserform.region.$error.pattern || changeuserform.region.$error.required)">
                            请输入长度 2-20位的渠道名字(中文，字母，数字组成)！
                        </div>
                        <div class="form-group">
                            <label for="tel">手机号</label>
                            <p style="color: #999999;">{{ currentUser.tel }}</p>
                        </div>
                        <div class="form-group">
                            <label for="email" ng-if='!currentUser.company_id'>邮箱</label>
                            <label for="email" ng-if='user_role == 1'>公司邮箱</label>
                            <p style="color: #999999;">{{ currentUser.email }}</p>
                        </div>
                        <button type="submit" class="btn btn-mt-ok">保存信息</button>
                    </form>
                </div>
            </div>
        </div>
        <div ng-show='tab_type == 2'>
            <div class="panel panel-default yf-shadow">
                <div class="panel-body">
                    <form name='changeuserform' role="form" novalidate ng-submit="putUser(changeuserform.$invalid, currentUser);">
                        <div class="form-group" ng-if='user_role == 1'>
                            <label for="nick_name">公司名称</label>
                            <p class="form-control-static">{{ currentUser.nick_name }}</p>
                        </div>
                        <div class="form-group" ng-if='user_role == 1'>
                            <label for="brand_name">公司品牌</label>
                            <p class="form-control-static">{{ currentUser.brand_name }}</p>
                        </div>

                        <div class="form-group" ng-if='user_role == 1'>
                            <label for="pic">公司logo <small class='logo-tip'>(建议上传200*50比例空白底logo，上传成功后不可修改)</small></label>
                            <p class="form-control-static" ng-if="!currentUser.company_logo.url">
                                <input type="file" style='display: none;' class="form-control" ng-model='currentUser.company_logo' id="pic-company-logo" placeholder="头像" required>
                                <img class="img-thumbnail company-brand-logo" ng-src="{{ currentUser.company_logo.url || 'components/mine/imgs/logo-brand.png' }}?imageView2/1/w/200/h/200/interlace/1" id='img-company-logo' onclick='document.getElementById("pic-company-logo").click()'>
                            </p>

                            <p class="form-control-static" ng-if="currentUser.company_logo.url">
                                <img class="img-thumbnail company-brand-logo" ng-src="{{ currentUser.company_logo.url }}?imageView2/1/w/200/h/200/interlace/1">
                            </p>
                        </div>

                        <div class="form-group">
                            <label class="">地址</label>
                            <p class="form-control-static">{{ currentUser.address }}</p>
                        </div>

                        <div class="form-group">
                            <label for="inputPassword" class="control-label">有效证件</label>
                            <div>
                                <img class="document-picture img-responsive" ng-src="{{ currentUser.pictures[0].image.url }}" data-action="zoom">
                            </div>
                        </div>
                        <button type="submit" class="btn btn-mt-ok" ng-if='user_role == 1&&!currentUser.company_logo.url'>保存信息</button>
                    </form>
                </div>
            </div>
        </div>
        <div ng-show='tab_type == 3'>
            <div class="panel panel-default yf-shadow">
                <div class="panel-body">
                    <form name='payform' role="form" novalidate ng-submit="savebrank(payform.$invalid, paydata);">
                        <div class="form-group">
                            <label for="name">银行卡帐户</label>
                            <input type="text" class="form-control" ng-model='paydata.account' name='account' ng-pattern="/^(\d{16}|\d{19})$/" id="name" placeholder="银行卡帐户" ng-disabled="!!paydata.id" required>
                        </div>
                        <div class="form-group error-container" ng-show="isbrank && (payform.account.$error.pattern || payform.account.$error.required)">
                            请输入长度 16-19位的银行卡号
                        </div>
                        <div class="form-group">
                            <label for="name">开户银行(例如：上海市工商银行)</label>
                            <input type="text" class="form-control" ng-model='paydata.channel_title' name='channel_title' ng-pattern="/^[A-Za-z0-9\u4e00-\u9fa5]{2,20}$/" id="name" placeholder="开户银行" ng-disabled="!!paydata.id" required>
                        </div>
                        <div class="form-group error-container" ng-show="isbrank && (payform.channel_title.$error.pattern || payform.channel_title.$error.required)">请输入开户银行</div>
                        <div class="form-group">
                            <label for="name">银行支行(例如：上海市长宁区福泉路支行)</label>
                            <input type="text" class="form-control" ng-model='paydata.open_bank' name='open_bank' ng-pattern="/^[A-Za-z0-9\u4e00-\u9fa5]{2,20}$/" id="name" placeholder="银行支行" ng-disabled="!!paydata.id" required>
                        </div>
                        <div class="form-group error-container" ng-show="isbrank && (payform.open_bank.$error.pattern || payform.open_bank.$error.required)">请输入银行支行</div>
                        <div class="form-group">
                            <label for="name">姓名</label>
                            <input type="text" class="form-control" ng-model='paydata.name' name='name' ng-pattern="/^[A-Za-z0-9\u4e00-\u9fa5]{2,20}$/" id="name" placeholder="姓名" ng-disabled="!!paydata.id" required>
                        </div>
                        <div class="form-group error-container" ng-show="isbrank && (payform.name.$error.pattern || payform.name.$error.required)">请输入真实姓名</div>
                        <label>注：账号仅可绑定一张银行卡并且不支持修改,若输入有误可联系客服</label>
                        <button type="submit" class="btn btn-mt-ok" ng-if="!paydata.id">保存信息</button>
                    </form>
                </div>
            </div>
        </div>
    </div>
</section>
